package com.lj.graduate.mapper;

import com.lj.graduate.controller.dto.ReleaseDetailDTO;
import com.lj.graduate.entity.ReleaseDetail;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author ljy
 * @since 2023-03-24
 */
public interface ReleaseDetailMapper extends BaseMapper<ReleaseDetail> {
    @Select("SELECT " +
            "release_detail.release_id," +
            "release_detail.creation_time," +
            "release_detail.release_picture," +
            "release_detail.release_text," +
            "release_detail.scenic_id," +
            "`user`.user_name," +
            "scenic_detail.scenic_name " +
            "FROM " +
            "release_detail " +
            "INNER JOIN `user` ON release_detail.user_id = `user`.user_id " +
            "INNER JOIN scenic_detail ON release_detail.scenic_id = scenic_detail.scenic_id ")
    List<ReleaseDetailDTO> selectPage(Integer pageNum, Integer pageSize);
}
